package com.qimu.saiyou.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseService;
import com.qimu.saiyou.model.dto.question.PaperQuestionDTO;
import com.qimu.saiyou.model.dto.question.QuestionDTO;
import com.qimu.saiyou.model.dto.question.QuestionQueryRequest;
import com.qimu.saiyou.model.entity.Question;
import com.qimu.saiyou.model.vo.QuestionVO;

import javax.servlet.http.HttpServletRequest;

/**
 * @author: FeiXiang
 * @description 针对表【question(题目)】的数据库操作Service
 * @createDate 2024-02-28 20:36:14
 */
public interface QuestionService extends MPJBaseService<Question> {
    /**
     * 校验
     *
     * @param question
     * @param add
     */
    void validQuestion(Question question, boolean add);

    /**
     * 获取查询条件
     *
     * @param questionQueryRequest
     * @return
     */
    QueryWrapper<Question> getQueryWrapper(QuestionQueryRequest questionQueryRequest);

    /**
     * 获取帖子封装
     *
     * @param question
     * @param request
     * @return
     */
    QuestionVO getQuestionVO(Question question, HttpServletRequest request);

    /**
     * 分页获取帖子封装
     *
     * @param questionPage
     * @param request
     * @return
     */
    Page<QuestionVO> getQuestionVOPage(Page<Question> questionPage, HttpServletRequest request);

    Page<QuestionVO> getQuestionVOPage(Page<Question> questionPage);

    Page<QuestionVO> getQuestionVOPageByDTO(Page<QuestionDTO> questionDTOPage);

    Page<QuestionVO> getQuestionPaperVOPageByDTO(Page<PaperQuestionDTO> questionDTOPage);

    Page<QuestionVO> getQuestionNoRightVOPage(Page<Question> questionPage);
}
